<?php
namespace app\common\validate;
use think\Validate;

class Category extends Validate{
    protected $rule=[
        ['name','require|max:10','分类名必须填写|分类名不能超过10个字符'],
        ['parent_id','number'],
        ['id','number'],
        ['status','number|in:-1,0,1','状态必须是数字|状态范围不合法'],
        ['listorder','number'],
    ];

    protected $scene=[
        'add'=>['name','parent_id','id'],
        'listorder'=>['id','listorder'],
        'status' =>['id','status'],
    ];
}